Skip to content

[rustdoc] Do not take doc(cfg()) into account when filtering doctests - #159014

Merged
rust-bors[bot] merged 6 commits into
rust-lang:mainfrom
GuillaumeGomez:doc-cfg-filter-doctest
Aug 6, 2026
Merged

[rustdoc] Do not take doc(cfg()) into account when filtering doctests#159014
rust-bors[bot] merged 6 commits into
rust-lang:mainfrom
GuillaumeGomez:doc-cfg-filter-doctest

Conversation

@GuillaumeGomez

@GuillaumeGomez GuillaumeGomez commented Jul 9, 2026

Copy link
Copy Markdown
Member

View all comments

Part of #147033.

Because it was using the extract_cfg_from_attrs common function, it was taking into account the doc(cfg()) attributes the same as if they were a cfg.

I didn't mark this PR as "fix" because I didn't handle the case of the doctest not being marked as ignored because I'm not sure if we should revisit the fact that we ignore these doctests or if we should just mark them as ignored (because of target_feature(enable = "...")).

Setting @fmease as reviewer as they are likely the only one with context about this issue. 😆

r? @fmease

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 9, 2026
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

And now it fails because we (doc) inlined some functions. Fixing that then. :)

@rustbot rustbot added O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows labels Jul 9, 2026
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
GuillaumeGomez force-pushed the doc-cfg-filter-doctest branch from f5059c8 to 062cfea Compare July 9, 2026 14:58
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
GuillaumeGomez force-pushed the doc-cfg-filter-doctest branch from 062cfea to 1d5692c Compare July 9, 2026 15:43
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Fixed CI \o/

Comment thread src/librustdoc/clean/cfg.rs
@GuillaumeGomez
GuillaumeGomez force-pushed the doc-cfg-filter-doctest branch from 1d5692c to a0bf3c9 Compare July 15, 2026 13:10
@rustbot

This comment has been minimized.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Reverted changes I made to extract_cfg_from_attrs and instead only look for the target_feature attributes.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Ah, new stuff gets added.

@GuillaumeGomez
GuillaumeGomez force-pushed the doc-cfg-filter-doctest branch from a0bf3c9 to 59a72c3 Compare July 15, 2026 14:50
@rustbot

rustbot commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

stdarch is developed in its own repository. If possible, consider making this change to rust-lang/stdarch instead.

cc @Amanieu, @folkertdev, @sayantn

@GuillaumeGomez
GuillaumeGomez force-pushed the doc-cfg-filter-doctest branch from 59a72c3 to 885af7e Compare July 15, 2026 15:53
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
GuillaumeGomez force-pushed the doc-cfg-filter-doctest branch from 885af7e to 21e8051 Compare July 15, 2026 20:35
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Seems like CI is happy now.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Setting a new reviewer as fmease seems busy.

r? @Urgau

@rustbot rustbot assigned Urgau and unassigned fmease Jul 24, 2026
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 4, 2026
@rust-bors

rust-bors Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#160507), which was unapproved.

View changes since this unapproval

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

@bors try jobs=x86_64-msvc-1,pr-check-2,aarch64-apple

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 4, 2026
[rustdoc] Do not take `doc(cfg())` into account when filtering doctests


try-job: x86_64-msvc-1
try-job: pr-check-2
try-job: aarch64-apple
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

💔 Test for b8642e4 failed: CI. Failed jobs:

@GuillaumeGomez
GuillaumeGomez force-pushed the doc-cfg-filter-doctest branch from e79eaf3 to 49dae43 Compare August 5, 2026 15:09
@rustbot

rustbot commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

@bors try jobs=x86_64-msvc-1,pr-check-2,aarch64-apple

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 5, 2026
[rustdoc] Do not take `doc(cfg())` into account when filtering doctests


try-job: x86_64-msvc-1
try-job: pr-check-2
try-job: aarch64-apple
@rust-bors

rust-bors Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 01c604d (01c604df897ad1942f50161832861a3eeb1f01fd)
Base parent: 22950ab (22950ab9e29e11620a10905f027f141ea126966e)

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

@bors r=Urgau rollup=iffy

@rust-bors

rust-bors Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 49dae43 has been approved by Urgau

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 5, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 5, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests)
 - #159029 (rustc_llvm: Emit module summaries when using -Clto=fat)
 - #160574 (Update rustc-perf submodule)
 - #154585 (treat no_mangle_generic_items as hard error instead of lint warning)
 - #159473 (Fix, simplify, and document doc meta finalize mode)
 - #157489 (Add CoerceShared field-wise reborrow WF checks)
 - #160532 (Add Enzyme bugfix to support rust+llvm23)
 - #160545 (Reorder the methods in `#[rustc_must_implement_one_of]`)
 - #160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`")
 - #160566 (Re-enable bool indexing assembly test for LLVM 23)
 - #160569 (Remove `OnDuplicate::Custom`)
 - #160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
@rust-bors
rust-bors Bot merged commit a5fb91e into rust-lang:main Aug 6, 2026
14 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 6, 2026
rust-timer added a commit that referenced this pull request Aug 6, 2026
Rollup merge of #159014 - GuillaumeGomez:doc-cfg-filter-doctest, r=Urgau

[rustdoc] Do not take `doc(cfg())` into account when filtering doctests

Part of #147033.

Because it was using the `extract_cfg_from_attrs` common function, it was taking into account the `doc(cfg())` attributes the same as if they were a `cfg`.

I didn't mark this PR as "fix" because I didn't handle the case of the doctest not being marked as ignored because I'm not sure if we should revisit the fact that we ignore these doctests or if we should just mark them as ignored (because of `target_feature(enable = "...")`).

Setting @fmease as reviewer as they are likely the only one with context about this issue. 😆

r? @fmease
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Aug 6, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests)
 - rust-lang/rust#159029 (rustc_llvm: Emit module summaries when using -Clto=fat)
 - rust-lang/rust#160574 (Update rustc-perf submodule)
 - rust-lang/rust#154585 (treat no_mangle_generic_items as hard error instead of lint warning)
 - rust-lang/rust#159473 (Fix, simplify, and document doc meta finalize mode)
 - rust-lang/rust#157489 (Add CoerceShared field-wise reborrow WF checks)
 - rust-lang/rust#160532 (Add Enzyme bugfix to support rust+llvm23)
 - rust-lang/rust#160545 (Reorder the methods in `#[rustc_must_implement_one_of]`)
 - rust-lang/rust#160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`")
 - rust-lang/rust#160566 (Re-enable bool indexing assembly test for LLVM 23)
 - rust-lang/rust#160569 (Remove `OnDuplicate::Custom`)
 - rust-lang/rust#160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs O-hermit Operating System: Hermit O-linux Operating system: Linux O-netbsd Operating system: NetBSD O-redox Operating system: Redox, https://www.redox-os.org/ O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants